//函数类
function JsUtil(){}

//创建对象
var jsUtil= $ = new JsUtil();

JsUtil.prototype.post = function(url,params,result) {

    var xmlhttp;
    //获取XMLHttpRequest对象
    if (window.XMLHttpRequest){//非ie
        xmlhttp = new XMLHttpRequest();
    }else{//ie
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    }

    //打开连接
    xmlhttp.open("post",url,true);
    xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded;charset=utf-8");
    //发送请求
    xmlhttp.send(params);
    //查询状态
    xmlhttp.onreadystatechange = callBack

    //回调函数的实现
    function callBack(){
        //查询状态
        if (xmlhttp.readyState==4 && xmlhttp.status==200){
            //获取响应的数据
            var str =xmlhttp.responseText;
            result = result(str);
        }
    }
}

function result(data) {}